/*******************************************************************************
 * Copyright (c) 2000, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package edu.uts.reekie.designer.execution.edit;

import org.eclipse.gef.Request;
import org.eclipse.gef.commands.*;
import org.eclipse.gef.requests.*;

import edu.uts.reekie.designer.edit.AbstractConnectorEditPolicy;
import edu.uts.reekie.designer.execution.actions.SetConnectorDecorationAction;
import edu.uts.reekie.designer.execution.model.*;
import edu.uts.reekie.designer.execution.model.commands.SetConnectorDecorationCommand;
import edu.uts.reekie.designer.model.*;
import edu.uts.reekie.designer.model.commands.*;



public class ConnectorEditPolicy
	extends AbstractConnectorEditPolicy
{
	
	
public Command getCommand(Request request){
	
	Object t = request.getType();
	
	for (String s: SetConnectorDecorationAction.getAllIds()){
		if (s.equals(t)){
			SetConnectorDecorationAction.Factory f = SetConnectorDecorationAction.all().get(s);
			SetConnectorDecorationCommand c = f.createCommand();
			c.setConnector((Connector)this.getHost().getModel());
			return c;
		}
	}
	
	return super.getCommand(request);
	
}



}
